# 指定CMake的最小版本
CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
PROJECT(napi_func)

add_definitions(-DOHOS_PLATFORM)

set(NAPI_BRIDGE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

set(TARGET_NAME napi_func)

SET(NAPI_BRIDGE_SRC ${NAPI_BRIDGE_ROOT_PATH}/src)

include_directories(${NAPI_BRIDGE_ROOT_PATH}/include)

add_library(${TARGET_NAME} STATIC
        include/func.h
        src/func.cpp
)

set_target_properties(${TARGET_NAME} PROPERTIES IMPORTED_NO_SONAME TRUE)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")

SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--emit-relocs --verbose")

target_link_libraries(${TARGET_NAME} PUBLIC libace_napi.z.so)
target_compile_features(${TARGET_NAME} PUBLIC cxx_std_17)

